Skip to content

Conversation

@18202781743
Copy link
Contributor

The change replaces NumberAnimation with XAnimator for the notification
bubble transition animation. XAnimator is more efficient for animating
x-position changes as it's specifically designed for this purpose and
can leverage hardware acceleration. This improves performance and makes
the animation smoother, especially when multiple notifications appear
in quick succession. The duration and easing type remain the same to
maintain consistent visual behavior.

fix: 在通知气泡中用 XAnimator 替换 NumberAnimation

此次更改将通知气泡的过渡动画从 NumberAnimation 替换为 XAnimator。
XAnimator 专门用于处理 x 轴位置变化的动画,能更好地利用硬件加速,从而提
高性能并使动画更加流畅,特别是在快速连续出现多个通知时。保持相同的持续时
间和缓动类型以确保视觉行为一致。

pms: BUG-297317

The change replaces NumberAnimation with XAnimator for the notification
bubble transition animation. XAnimator is more efficient for animating
x-position changes as it's specifically designed for this purpose and
can leverage hardware acceleration. This improves performance and makes
the animation smoother, especially when multiple notifications appear
in quick succession. The duration and easing type remain the same to
maintain consistent visual behavior.

fix: 在通知气泡中用 XAnimator 替换 NumberAnimation

此次更改将通知气泡的过渡动画从 NumberAnimation 替换为 XAnimator。
XAnimator 专门用于处理 x 轴位置变化的动画,能更好地利用硬件加速,从而提
高性能并使动画更加流畅,特别是在快速连续出现多个通知时。保持相同的持续时
间和缓动类型以确保视觉行为一致。

pms: BUG-297317
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We encountered an error and are unable to review this PR. We have been notified and are working to fix it.

You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.

@sourcery-ai
Copy link

sourcery-ai bot commented May 26, 2025

Reviewer's Guide

Replaces NumberAnimation with XAnimator for the notification bubble’s x-position transition to leverage hardware acceleration, improving performance and smoothing animations while retaining existing duration and easing settings.

Sequence Diagram: Notification Item X-Animation Method Change

sequenceDiagram
    participant TransitionLogic as "Transition (addTrans)"
    participant ItemToAnimate as "addTrans.ViewTransition.item"
    participant OldAnimator as "NumberAnimation"
    participant NewAnimator as "XAnimator"

    TransitionLogic->>ItemToAnimate: Start enter animation (x-movement)
    alt Previous Method (Software Animation)
        TransitionLogic->>OldAnimator: Use for animating 'x' property
        OldAnimator->>ItemToAnimate: Set 'x' over time based on 'properties', 'from', 'duration', 'easing.type'
    else New Method (Hardware-Accelerated Animation)
        TransitionLogic->>NewAnimator: Use for animating 'x' property (via target)
        NewAnimator->>ItemToAnimate: Set 'x' over time based on 'target', 'from', 'duration', 'easing.type'
    end
Loading

Class Diagram: Animator Component Replacement in Notification Transition

classDiagram
  class NumberAnimation {
    <<Removed Component in Transition>>
    +properties: String = "x"
    +from: String = "addTrans.ViewTransition.item.width"
    +duration: Int = 600
    +"easing.type": String = "Easing.OutExpo"
  }
  class XAnimator {
    <<Added Component in Transition>>
    +target: String = "addTrans.ViewTransition.item"
    +from: String = "addTrans.ViewTransition.item.width"
    +duration: Int = 600
    +"easing.type": String = "Easing.OutExpo"
  }
Loading

File-Level Changes

Change Details Files
Swap NumberAnimation for XAnimator in the transition implementation
  • Replaced element with
  • Added target property pointing to the transitioning item
  • Retained from, duration, and easing.type parameters to preserve behavior
panels/notification/bubble/package/main.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented May 26, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 099fb8a into linuxdeepin:master May 26, 2025
5 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants